package com.ajnp.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
//添加动态刷新  @RefreshScope 添加到@value类上 而不是启动类上
@RefreshScope
public class ClientContcontroller {

    //读取到配置文件
    @Value("${config.info}")
    private String configinfo;


    @GetMapping("/configinfo")
    public String getConfiginfo() {
        return configinfo;
    }


}
